package com.zho.common.utility.db;

import java.io.Serializable;

@SuppressWarnings("serial")
public class SearchItem implements Serializable {

	private String key;
	private String expression;
	private Object value;
	private Object defaultValue;
	private boolean usingDefaultValue;
	private String logicOperator;
	private boolean openingParenthesis;
	private boolean closingParenthesis;
	private boolean enableNullSearch;

	public SearchItem() {}

	public SearchItem(String key, Object value) {
		super();
		this.key = key;		
		this.value = value;		
	}
	
	public SearchItem(String key, String expression, Object value) {
		super();
		this.key = key;
		this.expression = expression;
		this.value = value;
		this.logicOperator = FilterLogicOperator.AND.getQlString();
	}
	
	public SearchItem(String expression) {
		super();
		this.expression = expression;
		this.logicOperator = FilterLogicOperator.AND.getQlString();
	}

	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}
	public String getExpression() {
		return expression;
	}
	public void setExpression(String expression) {
		this.expression = expression;
	}
	public Object getValue() {
		return value;
	}
	public void setValue(Object value) {
		this.value = value;
	}
	public Object getDefaultValue() {
		return defaultValue;
	}
	public void setDefaultValue(Object defaultValue) {
		this.defaultValue = defaultValue;
	}
	public boolean isUsingDefaultValue() {
		return usingDefaultValue;
	}
	public void setUsingDefaultValue(boolean usingDefaultValue) {
		this.usingDefaultValue = usingDefaultValue;
	}
	public String getLogicOperator() {
		return logicOperator;
	}
	public void setLogicOperator(String logicOperator) {
		this.logicOperator = logicOperator;
	}

	public boolean isOpeningParenthesis() {
		return openingParenthesis;
	}
	public void setOpeningParenthesis(boolean openingParenthesis) {
		this.openingParenthesis = openingParenthesis;
	}
	public boolean isClosingParenthesis() {
		return closingParenthesis;
	}
	public void setClosingParenthesis(boolean closingParenthesis) {
		this.closingParenthesis = closingParenthesis;
	}

	public boolean isEnableNullSearch() {
		return enableNullSearch;
	}

	public void setEnableNullSearch(boolean enableNullSearch) {
		this.enableNullSearch = enableNullSearch;
	}

}
